// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/parking/api/ParkControlApi'

import EditClass from '@api/parking/model/RoadwayControlReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 改 —————————————————————————————— //

  async edit({ id, command }, TIP = '道闸控制') {
    const DTO = CORE.grpcDTO(EditClass, { controlCode: id, command })
    await CORE.grpc(TIP, CLIENT, 'roadwayControl', DTO)
    return CORE.grpcOK(TIP)
  },
}
